package com.zzx.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zzx.po.ItemsCustom;

@Controller
public class JsonTest {
	

	
	/**请求json，回复json
	 * @param itemsCustom
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("/requestJson")
	public @ResponseBody ItemsCustom requestJson(@RequestBody ItemsCustom itemsCustom) throws Exception {
		
		return itemsCustom;
	}
	
	@RequestMapping("/qq")
	public String requestJson() throws Exception {
		System.out.println("test");
		return "";
	}
	
	
	/**请求key-value，回复json
	 * @param itemsCustom
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("/responseJson")
	public @ResponseBody ItemsCustom responseJson(ItemsCustom itemsCustom) throws Exception {
		return itemsCustom;
	}

}
